import java.util.Scanner;

public class test {
    public static int jie(int i){
        if(i == 1){
            return 1;
        }
        return i * jie(i - 1);
    }
    public static int jieNum(int i){
        int num = 0;
        for (int j = 1; j <= i; j++) {
            num += jie(j);
        }
        return num;
    }
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        int i = scan.nextInt();
        int func = jieNum(i);
        System.out.println(func);
    }
}